// To parse this JSON data, do
//
//     final locationInfoModel = locationInfoModelFromJson(jsonString);

import 'dart:convert';

LocationInfoModel locationInfoModelFromJson(String str) => LocationInfoModel.fromJson(json.decode(str));

String locationInfoModelToJson(LocationInfoModel data) => json.encode(data.toJson());

class LocationInfoModel {
  Component component;
  Address address;
  Geo geo;

  LocationInfoModel({
    required this.component,
    required this.address,
    required this.geo,
  });

  factory LocationInfoModel.fromJson(Map<String, dynamic> json) => LocationInfoModel(
    component: Component.fromJson(json["component"]),
    address: Address.fromJson(json["address"]),
    geo: Geo.fromJson(json["geo"]),
  );

  Map<String, dynamic> toJson() => {
    "component": component.toJson(),
    "address": address.toJson(),
    "geo": geo.toJson(),
  };
}

class Address {
  String format;
  String little;

  Address({
    required this.format,
    required this.little,
  });

  factory Address.fromJson(Map<String, dynamic> json) => Address(
    format: json["format"],
    little: json["little"],
  );

  Map<String, dynamic> toJson() => {
    "format": format,
    "little": little,
  };
}

class Component {
  String province;
  int provinceId;
  String city;
  int cityId;
  String district;
  int districtId;
  List<Business> business;
  String street;
  String streetNumber;

  Component({
    required this.province,
    required this.provinceId,
    required this.city,
    required this.cityId,
    required this.district,
    required this.districtId,
    required this.business,
    required this.street,
    required this.streetNumber,
  });

  factory Component.fromJson(Map<String, dynamic> json) => Component(
    province: json["province"],
    provinceId: json["provinceId"],
    city: json["city"],
    cityId: json["cityId"],
    district: json["district"],
    districtId: json["districtId"],
    business: List<Business>.from(json["business"].map((x) => Business.fromJson(x))),
    street: json["street"],
    streetNumber: json["streetNumber"],
  );

  Map<String, dynamic> toJson() => {
    "province": province,
    "provinceId": provinceId,
    "city": city,
    "cityId": cityId,
    "district": district,
    "districtId": districtId,
    "business": List<dynamic>.from(business.map((x) => x.toJson())),
    "street": street,
    "streetNumber": streetNumber,
  };
}

class Business {
  String name;
  String lng;
  String lat;

  Business({
    required this.name,
    required this.lng,
    required this.lat,
  });

  factory Business.fromJson(Map<String, dynamic> json) => Business(
    name: json["name"],
    lng: json["lng"],
    lat: json["lat"],
  );

  Map<String, dynamic> toJson() => {
    "name": name,
    "lng": lng,
    "lat": lat,
  };
}

class Geo {
  String lng;
  String lat;

  Geo({
    required this.lng,
    required this.lat,
  });

  factory Geo.fromJson(Map<String, dynamic> json) => Geo(
    lng: json["lng"],
    lat: json["lat"],
  );

  Map<String, dynamic> toJson() => {
    "lng": lng,
    "lat": lat,
  };
}
